home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 138
/
Volume 138 Aug 19 2011 - Damaged.iso
/
Games
/
shadez.swf
/
scripts
/
Local
/
Draw
/
CScreen_Debrief.as
< prev
next >
Wrap
Text File
|
2011-08-19
|
12KB
|
343 lines
package Local.Draw
{
import Local.CGlobal;
import Local.External.CURL;
import Local.Game.Level.CLevelData;
import Local.Math.CSecureNumber;
import flash.display.MovieClip;
import flash.events.Event;
import flash.geom.Rectangle;
import flash.text.TextField;
public class CScreen_Debrief extends CScreen
{
public static var mScore:CSecureNumber;
public static var mGameState:String;
private static const mStandardName:String = "[ENTER NAME]";
public var mcButtonRetry:MovieClip;
private var mPostWindow:CWindow_PostScore;
public var mcBackground:MovieClip;
public var mcLogo:MovieClip;
public var mcButtonBack:MovieClip;
public var mcButtonPostScore:MovieClip;
public var tbUsername:TextField;
public var mcMoreGames:MovieClip;
public var mcButtonViewScores:MovieClip;
public var mcSize:MovieClip;
public var mcScore:MovieClip;
public var mcGameState:MovieClip;
public var mcLock:MovieClip;
public function CScreen_Debrief()
{
if(true)
{
super();
if(true)
{
AddButton("postscore",new CScreenButton(mcButtonPostScore,Button_Default)).addEventListener(CScreenButton.MOUSECLICK,e_POSTSCORE);
if(true)
{
AddButton("viewscores",new CScreenButton(mcButtonViewScores,Button_Default)).addEventListener(CScreenButton.MOUSECLICK,e_VIEWSCORES);
if(true)
{
AddButton("retry",new CScreenButton(mcButtonRetry,Button_Default)).addEventListener(CScreenButton.MOUSECLICK,e_RETRY);
AddLogoButton();
}
AddBackButton("main");
}
AddMoreGamesButton("Debrief");
}
tbUsername.text = CGlobal.GetField("playerid") == null ? mStandardName : CGlobal.GetField("playerid");
}
}
private function e_WINDOW_DISPOSING(param1:Event = null) : void
{
if(true)
{
mPostWindow = null;
}
}
override public function Activate() : void
{
var _loc1_:Rectangle = null;
if(true)
{
super.Activate();
if(true)
{
FillScore(mcScore,mScore.mValue);
}
mcScore.x = 0;
}
_loc1_ = mcScore.getBounds(mcScore.parent);
if(true)
{
mcScore.x = (mSize.width - _loc1_.width) / 2 - _loc1_.x;
}
switch(mGameState)
{
case "complete":
mcGameState.gotoAndStop(1);
if(true)
{
mcLock.visible = !(mScore.mValue >= 1 && !CGlobal.GetField("CHEATS"));
addr96:
break;
}
break;
case "died":
mcGameState.gotoAndStop(2);
if(true)
{
}
§§goto(addr96);
case "exit":
mcGameState.gotoAndStop(3);
§§goto(addr96);
default:
§§goto(addr96);
}
}
private function e_RETRY(param1:Event = null) : void
{
var _loc2_:CScreenButton = null;
_loc2_ = CScreenButton(param1.currentTarget);
mParent.GetScreen("selectlevel").Activate();
}
private function e_VIEWSCORES(param1:Event = null) : void
{
var _loc2_:CScreenButton = null;
_loc2_ = CScreenButton(param1.currentTarget);
if(true)
{
CURL.ViewHiscore(CLevelData.mGameID);
}
}
override public function Process() : void
{
super.Process();
§§push(mPostWindow);
if(true)
{
if(§§pop())
{
addr16:
mPostWindow.Update();
}
return;
}
§§goto(addr16);
}
private function e_POSTSCORE(param1:Event = null) : void
{
var _loc2_:CScreenButton = null;
_loc2_ = CScreenButton(param1.currentTarget);
CGlobal.SetField("playerid",tbUsername.text);
addChild(mPostWindow = new CWindow_PostScore(stage));
§§push(mPostWindow);
§§push(CWindow_PostScore.CANCELLED);
if(true)
{
§§pop().addEventListener(§§pop(),e_WINDOW_PSCORE_CANCEL);
§§push(mPostWindow);
§§push(CWindow.DISPOSING);
}
§§pop().addEventListener(§§pop(),e_WINDOW_DISPOSING);
mcLock.visible = true;
}
private function FillScore(param1:MovieClip, param2:Number) : void
{
var _loc3_:int = 0;
var _loc4_:Number = NaN;
var _loc5_:int = 0;
var _loc6_:* = undefined;
var _loc7_:MovieClip = null;
var _loc8_:* = 0;
if(!param1.mBackupChildren)
{
param1.mBackupChildren = new Array();
_loc5_ = 0;
loop2:
while(true)
{
if(_loc5_ < param1.numChildren)
{
continue;
}
if(true)
{
addr88:
_loc3_ = 0;
addr90:
_loc4_ = 1;
}
loop5:
while(true)
{
§§push(_loc3_ < 12);
if(_loc3_ < 12)
{
addr205:
§§pop();
while(true)
{
§§push(Boolean(param1["d" + _loc3_]));
§§goto(addr205);
}
addr206:
}
while(true)
{
if(!§§pop())
{
break loop2;
}
_loc7_ = param1["d" + _loc3_];
§§push(int(Math.floor(param2 / _loc4_)));
§§push(int(Math.floor(param2 / _loc4_)));
if(true)
{
_loc8_ = §§pop();
§§push(0);
if(true)
{
§§push(§§pop() == §§pop());
if(true)
{
if(§§pop())
{
if(true)
{
§§pop();
§§push(_loc3_);
§§push(0);
if(true)
{
§§push(§§pop() == §§pop());
if(true)
{
§§push(!§§pop());
if(true)
{
addr140:
if(§§pop())
{
param1.removeChild(_loc7_);
}
else
{
_loc7_.gotoAndStop(_loc8_ % 10 + 1);
}
§§push(_loc3_ == 0);
if(true)
{
§§push(!§§pop());
if(true)
{
§§push(§§pop() && _loc3_ % 3 == 0);
}
if(§§pop())
{
}
addr181:
if(§§pop())
{
param1.removeChild(param1["c" + Math.floor(_loc3_ / 3 - 1)]);
}
_loc3_++;
_loc4_ *= 10;
continue loop5;
}
§§pop();
§§push(_loc8_ == 0);
}
if(§§pop())
{
}
§§goto(addr181);
}
§§pop();
addr180:
§§goto(addr181);
§§push(_loc3_ != 0);
}
§§goto(addr165);
}
§§goto(addr180);
}
§§goto(addr140);
}
§§goto(addr181);
}
§§goto(addr140);
}
§§goto(addr180);
continue loop5;
}
§§goto(addr205);
}
}
return;
}
do
{
if(param1.numChildren)
{
continue;
}
if(true)
{
var _loc9_:int = 0;
if(true)
{
for each(_loc6_ in param1.mBackupChildren)
{
if(true)
{
param1.addChild(_loc6_);
}
}
}
}
}
while(param1.removeChildAt(0), true);
§§goto(addr90);
§§goto(addr88);
}
private function e_WINDOW_PSCORE_CANCEL(param1:Event = null) : void
{
if(true)
{
mcLock.visible = false;
}
}
}
}